package edu.java.lectures.lec09.exceptions.hierarchy;

import edu.java.lectures.lec09.exceptions.creation.MyException;
import edu.java.lectures.lec09.exceptions.creation.MySubException;
import edu.java.lectures.lec09.exceptions.creation.MySubSubException;

public class MyExceptionHandlingTest {

    public static void main(String[] args) {
	MyClass myClass = new MyClass();

	try {
	    if (false) {
		myClass.doSomething1();
	    }
	    myClass.doSomething2();
	} catch (MySubSubException msse) {
	    System.out.println("MySubSubException handling: "
		    + msse.getMessage());
	} catch (MySubException e) {
	    System.out.println("MySubException handling: " + e.getMessage());
	} catch (MyException e) {
	    System.out.println("MyException handling: " + e.getMessage());
	} catch (Exception e) {
	    System.out.println("Exception handling: " + e.getMessage());
	}

	System.out.println("End of the test.");
    }
}
